<?php
/**
 *  view: dilaogs/dialogs_home.php
 */
?>
<h1><?php echo lang('dialogs'); ?></h1>
<form method="post" id="form-filter" name='form-dialogs-filter' action="" >
  
  <fieldset class="ui-widget-content ui-corner-all field_filter">
        <legend class="ui-widget-content ui-corner-all"><?=lang('filter')?></legend>
          <label style='text-align: right;'><?=lang('from')?>: </label>
              <select name="filter[from]" id="sb_from" class="text ui-widget-content ui-corner-all">
                  <option value=""></option>
                   <?php foreach ( $from_users as $option ) : 
                            $selected = ( $option->id == $from )?"selected":"";
                   ?>
                        <option value="<?php echo $option->id; ?>" <?=$selected?> ><?php echo $option->username; ?></option>
                   <?php endforeach; ?>
              </select>
                <br/>
           <label style='text-align: right;'><?=lang('to')?>: </label>
              <select name="filter[to]" id="sb_to" class="text ui-widget-content ui-corner-all">
                <?php
                if( $to_users != NULL )
                {
                  foreach ( $to_users as $option ) : 
                        $selected = ( $option->id == $from )?"selected":"";
                   ?>
                        <option value="<?php echo $option->id; ?>" <?=$selected?> ><?php echo $option->username; ?></option>
                   <?php endforeach;
                }
                ?>
              </select>
              <br/>
          <label> &nbsp; </label>
              <input type="button" name="filter_dialogs_submit" id="filter_submit" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('search');?>" />
              <input type="reset" name="filter_dialogs_reset" id="filter_reset" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('reset');?>" />
  </fieldset>
</form>
<br/>
<!--
  <div id="pager" class="pager">
	<form>
		<img src="<?=base_url()?>css/tablesorter/first.png" alt=" << " class="first">        
		<img src="<?=base_url()?>css/tablesorter/prev.png" alt=" < " class="prev">    
        
		<input class="pagedisplay ui-widget-content ui-corner-all" style='width:50px;' type="text">
        <select class="pagesize ui-widget-content ui-corner-all">
			<option selected="selected" value="5">5</option>
            <option value="20">10</option>
			<option value="20">20</option>
			<option value="30">30</option>
			<option value="40">40</option>
		</select>
        
		<img src="<?=base_url()?>css/tablesorter/next.png" alt=" > " class="next">
		<img src="<?=base_url()?>css/tablesorter/last.png" alt=" >>  " class="last">		
   	</form>
  </div>
<br/>
<br/>
-->

  <table id="dialogs" class='table_sorter table_pager dialog_table' width='100%' cellpadding=3px cellspacing=0>
   
    <tbody >
      <?php
      $this->load->view('dialogs/dialog_list');      
      ?>
    </tbody>
    
  </table>
 
<div id="dialog-user" class="hide" title="<?php echo lang('term_user'); ?>"></div>